Skip to main content
Feedback

Configuring Policy Path Mode for a Deployed API

Policy Path Mode defines the sequence of policy paths applied to an API request or response. These are designed to control the execution of different policy paths, allowing you to customize how APIs are consumed and managed when multiple policy paths are applied for an API. It supports the All Match and Best Match modes.

All Match

In All Match mode, the gateway executes policies from all paths that match the path of an API request. This is the default policy mode.

When multiple policy paths are applied to an API, the paths are ordered alphabetically, and if path mode is All Match, then all policy paths that match the API request will be executed in the same order.

Best Match

In Best Match mode, the gateway executes policies from the single path that most closely matches the path of an API request.

Here, the text part of the path will take precedence over a path parameter. It reads the text from left to right, comparing each part of the path. It compares all the policy paths, and the best-matching path is selected.

Example

For example, if you have policies in path “/” and “/api” and “/api/test”

  • For the API call http://test.com/api/test in All Match mode, this will execute policies defined in all paths - "/" , "/api", and "/api/test".

  • For the API call http://test.com/api/test in Best Match mode, this will execute policies defined in closest path, i.e "/api/test".

Procedure

  1. In API Management, select Configure APIs and Applications > Manage API. It displays list of deployed APIs.

  2. Select any deployed API.

  3. Navigate to the Settings tab and select Policy Path Mode.

  4. Select All Match or Best Match mode.

  5. Click Save.

    Image

On this Page